package sandbox.vaadin.skiller;

import sandbox.session.DefaultSessionContext;
import sandbox.vaadin.Util;
import sandbox.vaadin.Util.Size;
import sandbox.vaadin.skiller.entity.SkillgroupDAOSSB;
import sandbox.vaadin.skiller.skillgroupmanager.SkillgroupManager;

import com.vaadin.ui.VerticalLayout;

public class Skiller extends VerticalLayout
{
	private static final long serialVersionUID = 1L;

	public Skiller()
	{
		super();
		init();
	}

	public Skiller(Util.Size size)
	{
		this();
		Util.setSize(this, size);		
	}

	public Skiller(Util.Size width, Util.Size height)
  {
		this();		
		Util.setSize(this, width, height);
  }

	private void init()
	{
		SkillgroupDAOSSB dao = DefaultSessionContext.get().getSkillgroupDAO();
		
		dao.unpopulate();
		dao.populate();

		setMargin(true);

		SkillgroupManager skillgroupManager = new SkillgroupManager(Size.FULL);
		addComponent(skillgroupManager);
	}
}